# -*- coding: UTF-8 -*-

# 导入CSV模块
import csv

# 新建一个要写入的数据
datas = [['id', '32304A05201808061220063220B07'], ['username', '戊 辰 战 争'], ['level', 35], ['serverId', '18'], ['isVIP', False]]

# 写入一个CSV文件中
with open('./externalFile/user_18.csv', 'w', newline='') as csvfile:
    spamwriter = csv.writer(csvfile, delimiter=' ', quotechar='|', quoting=csv.QUOTE_MINIMAL)
    for row in datas:
        spamwriter.writerow(row)

# 从一个CSV文件中读取数据
with open('./externalFile/user_18.csv', 'r', newline='') as csvfile:
    spamreader = csv.reader(csvfile, delimiter=' ', quotechar='|', quoting=csv.QUOTE_MINIMAL)
    for row in spamreader:
        print(':'.join(row))
